All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JPanel

public class JPanel
extends JComponent
implements Accessible
JPanel is a generic lightweight container.

Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.

See Also:

Constructor Index

 o JPanel()
Create a new JPanel with a double buffer and a flow layout
 o JPanel(boolean)
Create a new JPanel with FlowLayout and the specified buffering strategy.
 o JPanel(LayoutManager)
Create a new buffered JPanel with the specified layout manager
 o JPanel(LayoutManager, boolean)
Creates a new JPanel with the specified layout manager and buffering strategy.

Method Index

 o getAccessibleContext()
Get the AccessibleContext associated with this JComponent
 o paintComponent(Graphics)
Overriden from JComponent, paint the backgroud if the component is opaque.
 o updateUI()
PENDING(jeff) - this should be done in BasicPanelUI

Constructors

 o JPanel
 public JPanel(LayoutManager layout,
               boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy.

Parameters:
layout - the LayoutManager to use
isDoubleBuffered - a boolean, true for double-buffering, which uses additional memory space to achieve fast, flicker-free updates
 o JPanel
 public JPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager

Parameters:
layout - the LayoutManager to use
 o JPanel
 public JPanel(boolean isDoubleBuffered)
Create a new JPanel with FlowLayout and the specified buffering strategy. If isDoubleBuffered is true, the JPanel will use a double buffer.

Parameters:
layout - the LayoutManager to use
isDoubleBuffered - a boolean, true for double-buffering, which uses additional memory space to achieve fast, flicker-free updates
 o JPanel
 public JPanel()
Create a new JPanel with a double buffer and a flow layout

Methods

 o updateUI
 public void updateUI()
PENDING(jeff) - this should be done in BasicPanelUI

Overrides:
updateUI in class JComponent
 o paintComponent
 public void paintComponent(Graphics g)
Overriden from JComponent, paint the backgroud if the component is opaque. The color used is the one returned by getBackground() Override this method if you want to change how the JPanel paints its background.

Parameters:
g - the Graphics context in which the painting occurs
Overrides:
paintComponent in class JComponent
 o getAccessibleContext
 public AccessibleContext getAccessibleContext()
Get the AccessibleContext associated with this JComponent

Returns:
the AccessibleContext of this JComponent
Overrides:
getAccessibleContext in class JComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index